﻿require('../bin/renderer.js')
//$("input [name='hostName']").blur(() => nameCheck())
document.getElementById("hostName").setAttribute("onblur", " nameCheck()")
const btn = document.querySelector('#login_btn')
function nameCheck() {
    var hostName = document.getElementById("hostName").value.trim()
    const regix = /^[1-9]\d{0,2}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+$/
    if (!hostName.match(regix)) {
        btn.disabled = true
        document.getElementById("msg").innerText = "请输入“xxx.xxx.xxx.xxx:oo”样式的ip地址！"
    } else {
        btn.disabled = false
        document.getElementById("msg").innerText = "" 
    }
}
